package com.rain.lo.service.impl;


import com.rain.lo.dao.UserDao;
import com.rain.lo.entity.User;
import com.rain.lo.service.UserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
* @author liuqin on 2018-08-30 16:00:48
*/
@Service("userService")
public class UserServiceImpl implements UserService {

	@Resource
	private UserDao userDao;

    @Override
    public List<User> list(long row, long num){
		return userDao.list((row-1)*num,num);
	}

    @Override
    public Long count(){
        return userDao.count();
	}

    @Override
    public User queryUserById(Integer id){
        return userDao.queryUserById(id);
	}

	@Override
	public User queryUserByName(String name) {
	   return userDao.queryUserByName(name);
	}

	@Override
	public User queryUserByMobile(String mobile) {
		return userDao.queryUserByMobile(mobile);
	}

	@Override
	public void save(User user){
		userDao.save(user);
	}
	
	@Override
	public void update(User user){
		userDao.update(user);
	}
	
	@Override
	public void delete(Integer id){
		userDao.delete(id);
	}
	
}
